const factorialWorker=new Worker("./factoralWorker.js");
factorialWorker.onmessage=({data})=>{
    console.log(data);
    const ele=document.querySelector("#result")
    let dom=document.createElement("div")
    dom.innerText=data;
    ele.appendChild(dom)

}

factorialWorker.postMessage(5)
factorialWorker.postMessage(7)
factorialWorker.postMessage(10)
factorialWorker.postMessage(20)
factorialWorker.postMessage(40)
factorialWorker.postMessage(80)
factorialWorker.postMessage(160)
factorialWorker.postMessage(400)